<?php
declare (strict_types = 1);

namespace app\admin\controller;

use think\captcha\facade\Captcha;
use think\facade\Request;
use app\common\service\AdminAdmin as S;

class Login extends Base
{
    //后台登录
    public function index(){return $this->getAuto(S::isLogin()?redirect(Request::root()??'/'):$this->fetch(),S::login(Request::param()));}

    // 验证码
    public function verify(){ob_clean(); return Captcha::create();}

    //退出登陆
    public function logout(){return $this->getJson(S::logout());}
}
